package org.me;

import org.jivesoftware.smack.Roster;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.packet.Presence.Type;
import org.jivesoftware.smack.util.StringUtils;
import org.me.utils.Koneksi;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class RequestMUC extends Activity {
	
	Roster roster;
	String requestname;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.request_muc);
		
		roster = Koneksi.getInstance().getConnection().getRoster();
		
		Typeface font = Typeface.createFromAsset(getAssets(), "fonts/tt0142m_.ttf");
		
		requestname = getIntent().getExtras().getString("userRequest");
		
		TextView textrequest = (TextView) findViewById(R.id.textrequest);
		textrequest.setTypeface(font);
		
		Button accept = (Button) findViewById(R.id.acceptmuc);
		accept.setTypeface(font);
		accept.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				
				Intent tesintent = new Intent(RequestMUC.this, Client.class);
				tesintent.putExtra("userRequest", requestname);
				tesintent.putExtra("roster", true);
				startActivity(tesintent);
			}
		});
		
		
		Button deny = (Button) findViewById(R.id.denymuc);
		deny.setTypeface(font);
		deny.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				
				
				Intent tesintent = new Intent(RequestMUC.this, Client.class);
				tesintent.putExtra("userRequest", requestname);
				tesintent.putExtra("roster", true);
				startActivity(tesintent);
			}
		});
	}
}
